<% user = session['user'] -%>
<% cur = @controller.class.controller_path -%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="author" content="Mickael Faivre-Macon" />
	<meta name="keywords" content="poker, manager, rails" />
	<meta name="description" content="Poker friend tour manager" />
	<meta name="robots" content="all" />
	<title>Poker Tour Manager</title>
	<%= javascript_include_tag "prototype", "effects", "controls", "application",  "dragdrop" %>
	<%case cur
      when 'game' %>
        <%= javascript_include_tag 'games' %>
  <%end%>
	<style type="text/css" title="currentStyle" media="screen">
		@import '/stylesheets/styles.css';
	</style>
</head>
<body>
<div id="container">
<ul id="header">
  <span id="title">Poker Tour Manager</span>
  <span id="clock"><%=Date.today.strftime('%A %b %d %Y')%></span>
  <span <% if cur=="welcome" then%>id="currentmenuline" <%end%>class="menuline"><a href="/"><%=I18n.t :menu_dashboard%></a></span>
  <% if user -%>
    <span <% if cur=="myinfo" then%>id="currentmenuline" <%end%> class="menuline"><a href="/myinfo"><%=I18n.t :menu_profile%></a></span>
    <span id="logout"><a href="/account/logout"><%=I18n.t :menu_logout%></a></span>
  <% else -%>
    <span <% if cur=="account" then%>id="currentmenuline" <%end%>class="menuline"><a href="/account/login"><%=I18n.t :menu_about%></a></span>
  <% end -%>
  <a href="?locale="><img src="/images/en-fr.gif"></a>
  
</ul>

<div id="side">
  <% if not user -%>
    <!-- Login -->
    <h3><%= I18n.t :login %></h3>
    <%=link_to(I18n.t(:new_account), {:controller=>'account', :action=>'signup'})%><br/>
    <br/>
     <% form_tag :controller=>'account', :action=> "login" do %>
      <label class="small"><%= I18n.t :email %>:</label>
      <input type="text" name="user[email]" id="user_email" size="10" value=""/><br/>
      <label class="small"><%= I18n.t :pwd %>:</label>
      <input type="password" name="user[password]" id="user_password" size="10"/><br/>
      <input type="submit" name="login" value="<%= I18n.t :login %> &#187;" class="submitbutton" />
      <% if @message -%><div id="notice"><%= @message %></div><% end %>
    <% end -%>
  <% else -%>
    <!-- sub menu -->
    <div class='button'><%= link_to(I18n.t(:create_group), {:controller=>'group',:action=>'create_form'}) %></div>
    <!-- Group list -->
    <% if user.groups.size > 0 -%>
      <h3><%= I18n.t :your_groups -%></h3>
      <ul class="mylist">
      <%= render(:partial=>'group/list', :collection=>user.groups.sort_by{|g| -g.games.size}) %>
      </ul>
    <% end -%>
  <% end -%>
  <div id="notice"><%= flash[:notice] %></div>
  <div id="info"><%= flash[:info] %></div>
</div>

<div id="content">

<!-- yield -->
<%= yield -%>

<p><br/><br/></p>
</div>

<div id="footer">
Poker Tour Manager beta version |
For any ideas, please write to us: <a href="mailto:protask@protaskm.com">protask@protaskm.com</a>
</div>

</div>

</body>
</html>
